﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cms.Model
{
    /// <summary>
    /// RSS 源类型
    /// </summary>
    public enum RssSourceType
    {
        None,
        /// <summary>
        /// RSS 地址
        /// </summary>
        Url,
        /// <summary>
        /// RSS 内容
        /// </summary>
        Content
    }
    /// <summary>
    /// RSS 源
    /// </summary>
    public class RssSource
    {
        public RssSource()
        {
            SourceType = RssSourceType.None;
        }
        public RssSource(RssSourceType _sourceType,string _source)
        {
            this.SourceType = _sourceType;
            this.Source = _source;
        }

        public RssSourceType SourceType { get; set; }
        public string Source { get; set; }
    }
    /// <summary>
    /// RSS 内容频道
    /// </summary>
    public class RssChannel
    {
        //channel
        /// <summary>
        /// 频道描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 频道标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 频道链接
        /// </summary>
        public string Link { get; set; }
        /// <summary>
        /// 发布日期
        /// </summary>
        public DateTime pubDate { get; set; }
        /// <summary>
        /// 最后生成日期
        /// </summary>
        public DateTime lastBuildDate { get; set; }
        /// <summary>
        /// 内容提供者地址
        /// </summary>
        public string Url { get; set; }
    }
    /// <summary>
    /// RSS 内容项
    /// </summary>
    public class RssItem
    {
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 链接
        /// </summary>
        public string Link { get; set; }
        public DateTime pubDate { get; set; }
        private RssItemImage _Image = null;
        /// <summary>
        /// 图片内容
        /// </summary>
        public RssItemImage Image {
            get { return _Image; }
            set { _Image = value; }
        }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
    }
    public class RssItemImage {
        public string  Title{get;set;}
        public string  Link{get;set ;}
        public string Description { get; set; }
    }
    public class RssBody {
        public RssBody() {
            ItemList = new List<RssItem>();
        }
        /// <summary>
        /// 频道
        /// </summary>
        public RssChannel Chanel { get; set; }
        /// <summary>
        /// 内容列表
        /// </summary>
        public List<RssItem> ItemList { get; set; }
    }
}
